﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileUploadList.aspx.cs"
    Inherits="RN.ERP.Web.UserControl.FileUploadList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../Styles/skins/blue/css/style.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/skins/blue/css/style_msg.css" rel="stylesheet" type="text/css" />
    <link rel="Stylesheet" type="text/css" href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <link href="../Styles/imagesview.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #divImages
        {
            padding-left: 20px;
        }
        .corpImages img
        {
            margin-right: 25px;
            border: 1px solid #eaeaea;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <!--表单-->
    <asp:HiddenField ID="hdnSysCode" runat="server" Value="EF" ClientIDMode="Static" />
    <asp:HiddenField ID="hdnFuncCode" runat="server" Value="Person" ClientIDMode="Static" />
    <asp:HiddenField ID="hdnObjectGuid" runat="server" ClientIDMode="Static" />
    
    <div>
        <div>
            <div class="xian">
                <div class="about_title">
                    <asp:Literal ID="lblTitle" runat="server">扫描件上传列表</asp:Literal></div>
            </div>
        </div>
        
        <!--上传提示-->
        <div id="tempContainer"></div>

        <!--图片列表-->
        <div id="divImages">
            <asp:Repeater ID="rptImgs" runat="server" OnItemCommand="rptImgs_ItemCommand">
                <ItemTemplate>
                    <div class="corpImages">
                        <asp:Image ID="imgCorpOrg" runat="server" CssClass="pointer imagesview" title="图片查看"
                            ImageUrl='<%# GetImgUrl(Container.DataItem.ToString()) %>' />
                        <div class="corpImagesTitle">
                            <span>扫描件<%# Container.ItemIndex+1 %></span></div>
                        <div class="corpImagesBtn">
                            <asp:Button ID="btnDel" runat="server" CommandName="del" OnClientClick="return confirm('确认需要删除此图片？');"
                                CommandArgument='<%# Container.DataItem %>' Text="删除图片" /></div>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
        </div>

        <!--按钮区-->
        <div style="margin: 20px auto;padding-top:20px;border-top:1px solid #43a9f5;text-align: center;display: block;clear:both;">
            <span onclick="ShowUpload()" class="yello_button" runat="server" id="btnUpload">上传扫描件</span>
        </div>
    </div>
    <script type="text/javascript" src="../Scripts/jquery.min.js"></script>
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript" src="../Scripts/imagesview.min.js"></script>
    <script type="text/javascript" language="javascript">
        function ShowUpload() {
            var o = $('#hdnObjectGuid').val();
            var s = $('#hdnSysCode').val();
            var f = $('#hdnFuncCode').val();
            parent.$.ligerDialog.close(); ////关闭dialog
            parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
            parent.ShowUpForm("../Person/PersonUploadFile.aspx?filename=" + o + "&SysCode=" + s + "&FuncCode=" + f, 510, 515);
            //            $.ligerDialog.open({ url: "../Person/PersonUploadFile.aspx?filename=" + o + "&SysCode=" + s + "&FuncCode=" + f, width: 510, height: 515, title: '请上传扫描件', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        }

        function returnToParent() {
            var oArg = new Object();
            oArg.childWinName = $('#hdnSysCode').val();
            oArg.funcCode = $('#hdnFuncCode').val();
            oArg.Result = 0;
            parent.window.OnClientCloseImg(oArg);
            window.parent.$.ligerDialog.close(); ////关闭dialog
            parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
            parent.window.focus();
        }

        function OnClientCloseImg(args) {
            var arg = args;
            if (arg) {
                if (arg.Result == 0) {
                    RefreshWin();
                }
            }
        }

        function RefreshWin() {
            location.href = location.href;
        }

        ///初始化操作
        (function () {
            HtmlRender();
        })();

        ///根据系统编号和功能编号获取HTML
        function HtmlRender() {
            var sysCode = $('#hdnSysCode').val();
            var funcCode = $('#hdnFuncCode').val();
            var url = "../LoadFiles/" + sysCode + "/" + funcCode + ".htm";

            $.ajax({
                url: url,
                type: "GET",
                cache: true,
                data: {},
                dataType: "html"
            }).done(function (htm) {
                $("#tempContainer").html(htm);
            })
        }

        img_init(".imagesview");
    </script>
    </form>
</body>
</html>
